// 主要是对wx.request 方法进行封装
// 用Promise 进行封装
function request (url, method = "GET", data = {}) {
	return new Promise((resolve, reject) => {
		wx.request({
			url,
			method,
			data,
			success: res => {
				// success
				resolve(res)
			}
		})
	})
}
// request.baseURL = "https://www.zhengzhicheng.cn/api/public/v1/";
// request.baseURL = "https://itjustfun.cn/api/public/v1/";
request.baseURL = "https://autumnfish.cn/wx/api/public/v1/";

request.get = function (url, data) {
	return request(request.baseURL + url, "GET", data)
}
export default request